//
//  CreditCardManager.m
//  EasyToo
//
//  Created by zhengzhe on 13-8-25.
//
//

#import "CreditCardManager.h"
#import "ServerCommunicationManager.h"

#import "CreditCardRechargeRequest.h"
#import "CreditCardRechargeResponse.h"


@implementation CreditCardManager

static CreditCardManager* gManager = nil;


+ (CreditCardManager*)shareManager
{
    if (gManager == nil) {
        gManager = [[CreditCardManager alloc] init];
    }
    return gManager;
}

//信用卡充值
- (id)creditCardRecharge:(NSString*)creditcardno
                   money:(NSString*)money
                  mobile:(NSString*)mobile
          creditcardbank:(NSString*)creditcardbank
{
    CreditCardRechargeRequest *request = [[CreditCardRechargeRequest alloc] creditCardRecharge:self
                                                                                  creditcardno:creditcardno
                                                                                         money:money
                                                                                        mobile:mobile
                                                                                creditcardbank:creditcardbank];
    [[ServerCommunicationManager GetServerCommunication] sendRequest:request];
}


- (void)onRequestSuccess:(BaseResponse *)response
{
    if ([response isKindOfClass:[CreditCardRechargeResponse class]])
    {
        [self handleCreditCardRechargeSuccess:(CreditCardRechargeResponse*)response];
    }
    
}

- (void)onRequestFail:(BaseResponse *)response
{
    if ([response isKindOfClass:[CreditCardRechargeResponse class]])
    {
        [self.delegate qryAllSiteInfo:NO AllSiteInfo:nil TicketInfoArray:nil];
    }
}


//信用卡充值
- (void)handleCreditCardRechargeSuccess:(CreditCardRechargeResponse*)response
{
    //    NSMutableArray *siteInfoArray = response.siteInfoArray;
    //    NSMutableArray *tiketInfoArray = response.ticketInfoArray;
    //    if (siteInfoArray && tiketInfoArray)
    //    {
    //        [self.delegate qryAllSiteInfo:YES AllSiteInfo:siteInfoArray TicketInfoArray:tiketInfoArray];
    //    }
    //    else
    //    {
    //        [self.delegate qryAllSiteInfo:NO AllSiteInfo:nil TicketInfoArray:nil];
    //    }
}

@end
